package oralExamSchedulingSystem;

import java.util.ArrayList;
import java.util.Iterator;

public class Student 
{
	private int _sid;
	private String _class;
	private int _classNum;
	private String _name ;
	private char _sex;
	private ArrayList<Group> groupBelonged;

	public Student(int sid,String className,int classNumber,String name,char sex){
		this._sid=sid;
		this._class=className;
		this._classNum=classNumber;
		this._name=name;
		this._sex=sex;
		groupBelonged=new ArrayList<Group>();
	}
	
	public void assignedTo(Group grp){
		groupBelonged.add(grp);
	}
	public boolean belongToGroup(Group belongedGroup){
		return groupBelonged.contains(belongedGroup);
	}
	
	public String getClassName(){
		return this._class;
	}
	
	public String toString(){
		return _class+":"+_classNum+":"+_name;
	}

	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		
		if (obj instanceof Student){
			Student student= (Student)obj;
			if(this._sid==student._sid && this._class.equals(student._class) && this._classNum==student._classNum && this._name.equals(student._name) && this._sex==student._sex)
				return true;
		}
		return false;
	}
	
	
	
}